<?php
require('../../../lib/base.php');
$base=new base(array('web','mail'));
$mail=$base->get('mail',true);
if(!$mail){
	$helper->SMessage(5,domain,"info","您输入的链接有误,5秒后返回首页.",true);
	exit();
}
$member=$base->model('member');
$user=$member->GMember(array('where'=>array('mail ='=>$mail)));
if(count($user)!=1){
	$helper->SMessage(5,$_SERVER['HTTP_REFERER'],"info","这个帐户不存在,请检查您的链接.",true);
	exit();
}
$data['menu']=$base->cache(array('tag'=>'web.header','time'=>86400));
$data['menu']=unserialize($data['menu']);
$data['foot']=$base->cache(array('tag'=>'web.footer','time'=>86400));
$information=$base->model('information');
$info=$information->GMation(array('where'=>array('member ='=>$user[0]['id'])));
$config=$base->model('config');
$tpl=reset($config->GConfig(array('where'=>array('label='=>'mail','name='=>'activation'))));
$tpl=unserialize($tpl['value']);
$email=$base->library('email');
$email->IsSMTP();
$email->AddAddress($mail,$info[0]['name']);
$email->Subject=$tpl['subject'];
$email->MsgHTML($config->parse($tpl['content'],array('name'=>$name,'code'=>$user[0]['key'])));
$email->Send();
$entry=array('163'=>'mail.163.com','139'=>'mail.10086.cn','sohu'=>'mail.sohu.com','tom'=>'mail.tom.com','189'=>'mail.189.cn','126'=>'www.126.com','gmail'=>'gmail.google.com'
,'sina'=>'mail.sina.com.cn','hotmail'=>'www.hotmail.com','live'=>'www.hotmail.com','sogou'=>'mail.sogou.com','qq'=>'mail.qq.com','yahoo'=>'mail.cn.yahoo.com','eyou'=>'www.eyou.com','21cn'=>'mail.21cn.com'
,'188'=>'www.188.com','yeah'=>'www.yeah.net','foxmail'=>'www.foxmail.com','wo'=>'mail.wo.com.cn','263'=>'www.263.net');
$data=array('mail'=>$mail);
foreach($entry as $key=>$value){
	if(strpos($mail,$key.'')!==false){$data['go']='http://'.$value;break;}
}
$base->set($data);
$base->view('view/mailok.php');
?>